<template></template>

<script>
import { defineComponent } from 'vue'
import { useUserStore } from '@/store'

const userStore = useUserStore()
export default defineComponent({
  beforeRouteEnter(to, from, next) {
    next(reach => {
      reach.$router
        .replace({
          path: from.path,
          params: to.params,
          query: to.query,
        })
        .finally(() => userStore.getUserInfo())
    })
  },
})
</script>
